package com.cn.sys.frame.util;

import java.io.IOException;
import java.io.InputStream;
import java.util.Properties;

public class PropertiesUtil {

	Properties properties = new Properties();
	InputStream in = null;

	public PropertiesUtil() {
		this("/jdbc.properties");
	}

	public PropertiesUtil(String path) {
		try {
			in = this.getClass().getResourceAsStream(path);
			properties.load(in);
		} catch (Exception e) {
			e.printStackTrace();
		}finally{
			try {
				in.close();
			} catch (IOException e) {
				e.printStackTrace();
			}
		}
	}
	
	public String getValue(String key){
		String value = properties.getProperty(key);
		if (value!=null) {
			value = value.trim();
		}
		return value;
	}
}
